package com.fresh.fresh.controller;

import com.fresh.fresh.dao.Category;
import com.fresh.fresh.service.CategoryService;
import com.fresh.fresh.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/class")
@Api(tags = "分类接口")
public class CategoryController {

    @Autowired
    CategoryService categoryService;

    @GetMapping("/classAll")
    @ApiOperation("获取全部分类接口")
    public Result<?> all(){
        List<Category> data = categoryService.CategoryAll();
        return Result.success(data);
    }

}
